summon armor_stand ~ ~ ~ {Tags:[temp],Invisible:true,Marker:true,Invulnerable:true}
$loot replace entity @n[tag=temp,distance=..5,type=armor_stand] weapon.mainhand loot $(path)
data modify entity @n[tag=smithingTable.itemSlot,distance=..5,type=item_display] item set from entity @n[tag=temp,distance=..5,type=armor_stand] HandItems[0]
kill @n[tag=temp,distance=..5,type=armor_stand]

#SUCCESS
function vs:system/game_ctrol/smithing_table/forge/forge_success